home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earkit / news / thor / rexx / trapdoorpoll.thor < prev    next >
Text File  |  1998-05-24  |  2KB  |  91 lines

  1. /* TrapDoorPoll.thor by Troels Walsted Hansen
  2. ** $VER: TrapDoorPoll.thor 1.50 (3.6.95)
  3. **
  4. ** An ARexx script that automates TrapDoor polling of a
  5. ** BBS selected from a listview. The script assumes that
  6. ** you have configured one main TrapDoor.cfg and several
  7. ** small cfg files for each of your bosses.
  8. **
  9. ** History:
  10. ** ¯¯¯¯¯¯¯¯
  11. ** TrapDoorPoll.thor v1.10 (25.11.94)
  12. **  · don't open requester if there's only one boss configured
  13. **
  14. ** TrapDoorPoll.thor v1.50 (03.06.95)
  15. **  · if NComm is running you will be prompted with the option of quitting it
  16. */
  17.  
  18. /* config the below according to your setup */
  19.  
  20. trapdoorpath = "MAIL:Bin/"    /* must end with either ":" or "/" */
  21.  
  22. BOSS.1 = "ProSoft Node #1"
  23. CONFIG.1 = "mail:TrapDoor.cfg.prosoft1"
  24.  
  25. BOSS.2 = "ProSoft Node #2"
  26. CONFIG.2 = "mail:TrapDoor.cfg.prosoft2"
  27.  
  28. BOSS.3 = "AmigaZone"
  29. CONFIG.3 = "mail:TrapDoor.cfg.amizone"
  30.  
  31. BOSS.COUNT = 3            /* number of configured bosses */
  32.  
  33. /* don't touch anything below here */
  34.  
  35. options results
  36.  
  37. /* needs THOR and bbsread.library functions */
  38.  
  39. p = ' ' || address() || ' ' || show('P',,)
  40. thorport = pos(' THOR.',p)
  41.  
  42. if thorport > 0 then thorport = word(substr(p,thorport+1),1)
  43. else
  44. do
  45.     say 'No THOR port found!'
  46.     exit 10
  47. end
  48.  
  49. if ~show('p', 'BBSREAD') then
  50. do
  51.     address command
  52.         "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  53.         "WaitForPort BBSREAD"
  54. end
  55.  
  56. /* request BBSes or dial the only one configured */
  57.  
  58. select
  59.     when(BOSS.COUNT = 1) then result = BOSS.1
  60.     when(BOSS.COUNT > 1) then
  61.     do
  62.         address(thorport)
  63.         THORTOFRONT
  64.         REQUESTLIST instem BOSS title '"Select BBS to poll:"' SIZEGADGET
  65.         if(rc ~= 0) then exit
  66.     end
  67.     otherwise exit
  68. end
  69.  
  70. do i=1 to BOSS.COUNT
  71.     if(result = BOSS.i) then break
  72. end
  73.  
  74. /* if NComm is started it'll probably be holding on to the serial port */
  75.  
  76. if(show('p', 'ncomm')) then
  77. do
  78.     address(thorport)
  79.     REQUESTNOTIFY TEXT '"Do you want to quit NComm?"' BT '"_Yes|No"'
  80.     if(result = 1) then
  81.     do
  82.         address('ncomm')
  83.         QUIT
  84.     end
  85. end
  86.  
  87. /* start TrapDoor */
  88.  
  89. address command "run >nil: " || trapdoorpath || "TrapDoor CONFIG " || CONFIG.i
  90. exit
  91.